#ifndef __SphereH__
#define __SphereH__

#include "vectors.h"
#include "Ray.h"
#include "Material.h"
class KDTree;

class Sphere
{
	friend KDTree;
public:
	Sphere(Vec3f center, float radius, Material *pMaterial);
	bool intersect(const Ray *pRay, Hit *pHit, float tmin, float tmax);
	bool intersectShadowRay(const Ray *pRay, float tmin, float tmax);
	void debugMessage() 
	{
		printf("Spherd:m_center(%.3f,%.3f,%.3f),m_radius(%.3f)\n",
			m_center.r(),m_center.g(),m_center.b(),m_radius);
	}
private:
	Vec3f m_center;
	float m_radius;
	Material *m_pMaterial;
};
#endif